package org.jivesoftware.smackx.pubsub.provider;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smackx.packet.DataForm;
import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider;
import org.jivesoftware.smackx.pubsub.ConfigurationEvent;
import org.jivesoftware.smackx.pubsub.ConfigureForm;

public class ConfigEventProvider extends EmbeddedExtensionProvider
{
  protected PacketExtension createReturnExtension(String paramString1, String paramString2, Map<String, String> paramMap, List<? extends PacketExtension> paramList)
  {
    ConfigurationEvent localConfigurationEvent;
    if (paramList.size() == 0)
      localConfigurationEvent = new ConfigurationEvent((String)paramMap.get("node"));
    while (true)
    {
      return localConfigurationEvent;
      localConfigurationEvent = new ConfigurationEvent((String)paramMap.get("node"), new ConfigureForm((DataForm)paramList.iterator().next()));
    }
  }
}